package org.magicat.bridge.serializer;
import java.io.IOException;
import java.io.OutputStream;


public class MockOutputStream extends OutputStream {

	private byte[] bytes;
	private int pos = 0;
	
	public MockOutputStream(int len) {
		bytes = new byte[len];
	}

	@Override
	public void write(int b) throws IOException {
		bytes[pos++] = (byte) b;
	}
	
	public byte[] getBytes() {
		return this.bytes;
	}
	
	public int getPos() {
		return this.pos;
	}
}
